home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / CONTAS2.PAK / MAINFRM.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  109 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Contain.h"
  6.  
  7. #include "MainFrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMainFrame
  17.  
  18. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  19.  
  20. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  21.     //{{AFX_MSG_MAP(CMainFrame)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code !
  24.     ON_WM_CREATE()
  25.     //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. static UINT indicators[] =
  29. {
  30.     ID_SEPARATOR,           // status line indicator
  31.     ID_INDICATOR_CAPS,
  32.     ID_INDICATOR_NUM,
  33.     ID_INDICATOR_SCRL,
  34. };
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CMainFrame construction/destruction
  38.  
  39. CMainFrame::CMainFrame()
  40. {
  41.     // TODO: add member initialization code here
  42.     
  43. }
  44.  
  45. CMainFrame::~CMainFrame()
  46. {
  47. }
  48.  
  49. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  50. {
  51.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  52.         return -1;
  53.     
  54.     if (!m_wndToolBar.Create(this) ||
  55.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  56.     {
  57.         TRACE0("Failed to create toolbar\n");
  58.         return -1;      // fail to create
  59.     }
  60.  
  61.     if (!m_wndStatusBar.Create(this) ||
  62.         !m_wndStatusBar.SetIndicators(indicators,
  63.           sizeof(indicators)/sizeof(UINT)))
  64.     {
  65.         TRACE0("Failed to create status bar\n");
  66.         return -1;      // fail to create
  67.     }
  68.  
  69.     // TODO: Remove this if you don't want tool tips
  70.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  71.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  72.     
  73.     // TODO: Delete these three lines if you don't want the toolbar to
  74.     //  be dockable
  75.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  76.     EnableDocking(CBRS_ALIGN_ANY);
  77.     DockControlBar(&m_wndToolBar);
  78.  
  79.  
  80.     return 0;
  81. }
  82.  
  83. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  84. {
  85.     // TODO: Modify the Window class or styles here by modifying
  86.     //  the CREATESTRUCT cs
  87.  
  88.     return CMDIFrameWnd::PreCreateWindow(cs);
  89. }
  90.  
  91. /////////////////////////////////////////////////////////////////////////////
  92. // CMainFrame diagnostics
  93.  
  94. #ifdef _DEBUG
  95. void CMainFrame::AssertValid() const
  96. {
  97.     CMDIFrameWnd::AssertValid();
  98. }
  99.  
  100. void CMainFrame::Dump(CDumpContext& dc) const
  101. {
  102.     CMDIFrameWnd::Dump(dc);
  103. }
  104.  
  105. #endif //_DEBUG
  106.  
  107. /////////////////////////////////////////////////////////////////////////////
  108. // CMainFrame message handlers
  109.